.\" Process this file with
.\" groff -man -Tascii shttpd.1
.\" $Id: shttpd.1,v 1.3 2005/06/13 19:01:03 drozd Exp $
.Dd June 13, 2005
.Dt SHTTPD 1
.Sh NAME
.Nm shttpd
.Nd simple web server
.Sh SYNOPSIS
.Nm
.Op Fl DISv
.Op Fl C Ar configfile
.Op Fl d Ar document_root
.Op Fl P Ar global_htpasswd
.Op Fl p Ar port
.Op Fl c Ar cgi_pattern
.Op Fl l Ar access_log
.Op Fl e Ar error_log
.Op Fl u Ar login
.Op Fl N Ar realm
.Op Fl s Ar certificate
.Op Fl m Ar mime_types_file
.Nm
.Op Fl A Ar htpasswd_file realm username password
.Sh DESCRIPTION
.Nm
is small, fast and easy to use web server with CGI, SSL, Digest Authorization.
.Nm
can be run as stand-alone server or be managed by
.Xr inetd 8 .
.Nm
is embeddable into existing applications. Embedded API, instructions
and examples can be found on
.Nm
website, http://shttpd.sourceforge.net. Full list of features is as follows:
.Pp
.Nm
can take configuration parameters from two sources: from the command
line and from the configuration file. Command line parameters have
higher priority. Every command line parameter has associated configuration
file keyword, except
.Fl A
and
.Fl C
parameters. Each line in configuration
file must have two entries: configuration keyword and value. If line is blank
or is started with
.Dq #
character, the line is ignored. If both command line parameter and configuration
file option not specified, the default value is taken. The configuration
file may not be present at all.
.Sh OPTIONS
Below is the list of command line parameters, default values, and
associated configuration file keywords.
.Bl -tag -width indent
.It Fl A Ar htpasswd server_name user_name user_password
Edit the passwords file. Functionality similar to Apache's
.Ic htdigest
utility.
.It Fl C Ar configfile
Configuration file to use. Default:
.Pa /usr/local/etc/shttpd.conf .
.It Fl D
Disable directory listing. Default: enabled.
.br
.Cm list_directories Op Ar 0 | 1
.It Fl I
Enable inetd mode. Default: disabled.
.br
.Cm inetd_mode Op Ar 0 | 1
.It Fl N Ar server_name
Server domain name, used in authorization as the realm. Default:
.Dq mydomain.com
.br
.Cm server_name Ar domain
.It Fl P Ar global_htpasswd
Location of global passwords file. Per-directory .htpasswd files are
ignored, if this option is set. Default: not set.
.br
.Cm global_htpasswd Ar file
.It Fl S
Enable SSL. Default: disabled.
.br
.Cm use_ssl Op Ar 0 | 1
.It Fl c Ar cgi_extention
CGI filename pattern. For every requested file,
.Nm
uses the pattern to figure out whether to return the file content,
ot run the file as CGI application. Default:
.Dq .cgi .
.br
.Cm cgi_extention Ar extention
.It Fl d Ar document_root
Location of the WWW root directory. Default: working directory from which
.Nm
has been started.
.br
.Cm document_root Ar directory	
.It Fl e Ar error_log
Access log file. Default: not set, stderr is used.
.br
.Cm error_log Ar file
.It Fl l Ar access_log
Access log file. Default:
.Dq access.log .
.br
.Cm access_log Ar file
.Cm ssl_certificate Ar file
.It Fl m Ar mime_types
Location of mime types file. Default: not set, builtins are used.
.br
.Cm mime_types Ar file
.It Fl p Ar port
Listening port. Default: 80 for non-SSL and 443 for SSL mode.
.br
.Cm listen_port Ar port
.It Fl s Ar certificate
Location of SSL certificate file. Default:
.Dq shttpd.pem
.br
.It Fl u Ar login
Switch to given user ID after startup. Default: not set
.br
.Cm runtime_uid Ar login
.It Fl v
Enable debugging output to the error log. Default: disabled.
.br
.Cm debug Op Ar 0 | 1
.El
.Pp
If
.Nm
must be managed by
.Xr inetd 8 ,
add this line to
.Pa inetd.conf :
.Pp
.Dl http stream tcp nowait nobody /usr/local/bin/shttpd shttpd -I
.Pp
.Sh FILES
.Pa /usr/local/etc/shttpd.conf
.I inetd(8)
.Sh COPYRIGHT
.Nm
is licensed under the terms of MIT license.
.Sh AUTHOR
.An Sergey Lyubka Aq valenok@gmail.com .
